package com.yonyou.cyxdms.sysmanage.client.domains.dto;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yonyou.cyx.framework.bean.entity.base.BasePO;
import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;
import com.yonyou.cyx.function.utils.jsonserializer.localdatetime.JsonLocalDateTimeDeserializer;
import com.yonyou.cyx.function.utils.jsonserializer.localdatetime.JsonLocalDateTimeSerializer;
import com.yonyou.cyxdms.framework.bean.dto.base.DMSBaseDTO;

import java.io.Serializable;
import java.time.LocalDateTime;


/**
 * <p>
 * 公司表，车厂、经销商公司、改装厂公司等所
 * </p>
 *
 * @author quankk
 * @since 2019-08-26
 */

public class CompanyDTO extends DMSBaseDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * DEALER_ID
     */
    private Integer companyId;
    /**
     * 公司代码
     */
    private String companyCode;
    /**
     * 公司类型,和ORG_TYPE使用同一个类型
     */
    private Integer companyType;
    /**
     * 公司中文全称
     */
    private String companyNameCn;
    /**
     * 公司简称中文
     */
    private String companyNameEn;
    /**
     * 公司简称中文
     */
    private String companyShortNameCn;
    /**
     * 公司简称英文
     */
    private String companyShortNameEn;
    /**
     * 组织ID，与组织间是一一对应
     */
    private Integer orgId;
    /**
     * 工厂ID
     */
    private Integer factoryCompanyId;
    /**
     * 有效状态
     */
    private Integer validStatus;
    /**
     * 省份
     */
    private Integer provinceId;
    /**
     * 城市
     */
    private Integer cityId;
    /**
     * 公司地址中文
     */
    private String addressZh;
    /**
     * 公司地址英文
     */
    private String addressEn;
    /**
     * 联系电话
     */
    private String phone;
    /**
     * 邮编
     */
    private String zipCode;
    /**
     * 传真
     */
    private String fax;
    /**
     * 数据类型：经销商、集团
     */
    private Integer dataType;
    /**
     * 数据库租户ID
     */
    private String tenantId;
    /**
     * 来源日期
     */
    @JsonDeserialize(using = JsonLocalDateTimeDeserializer.class)
    @JsonSerialize(using = JsonLocalDateTimeSerializer.class)
    private LocalDateTime sourceChangedAt;
    /**
     * 所在区县
     */
    private Integer county;
    /**
     * 企业性质
     */
    private String property;
    /**
     * E_MAIL
     */
    private String eMail;
    /**
     * 开业日期
     */
    @JsonDeserialize(using = JsonLocalDateTimeDeserializer.class)
    @JsonSerialize(using = JsonLocalDateTimeSerializer.class)
    private LocalDateTime openDate;
    /**
     * 24小时热线电话
     */
    private String hotLine;
    /**
     * 销售热线
     */
    private String salesLine;
    /**
     * 售后热线
     */
    private String serviceLine;
    /**
     * 营业时间
     */
    private String businessHours;
    /**
     * 建站日期
     */
    private LocalDateTime createdDate;
    /**
     * 待开业，已开业，停业\r\n
     */
    private Integer dealerStatus;
    /**
     * 公司主页
     */
    private String companyHomepage;
    /**
     * 备注
     */
    private String remark;
    /**
     * 是否主店
     */
    private Integer isMain;
    /**
     * 是否执行固化权限控制
     */
    private Integer isFixed;
    /**
     * 畅捷支付合作者id
     */
    private String partnerId;
    /**
     * 私钥
     */
    private String privateKey;
    /**
     * 公钥
     */
    private String publicKey;
    /**
     * 公司地址中文
     */
    private String addressCn;
    private Integer isDeleted;

    private Integer isMerge;

    private Integer isDisArea;

    public Integer getIsMerge() {
        return isMerge;
    }

    public void setIsMerge(Integer isMerge) {
        this.isMerge = isMerge;
    }

    public Integer getIsDisArea() {
        return isDisArea;
    }

    public void setIsDisArea(Integer isDisArea) {
        this.isDisArea = isDisArea;
    }

    public CompanyDTO() {
        super();
    }


    public Integer getCompanyId() {
        return companyId;
    }


    public void setCompanyId(Integer companyId) {
        this.companyId = companyId;
    }


    public String getCompanyCode() {
        return companyCode;
    }


    public void setCompanyCode(String companyCode) {
        this.companyCode = companyCode;
    }


    public Integer getCompanyType() {
        return companyType;
    }


    public void setCompanyType(Integer companyType) {
        this.companyType = companyType;
    }


    public String getCompanyNameCn() {
        return companyNameCn;
    }


    public void setCompanyNameCn(String companyNameCn) {
        this.companyNameCn = companyNameCn;
    }


    public String getCompanyNameEn() {
        return companyNameEn;
    }


    public void setCompanyNameEn(String companyNameEn) {
        this.companyNameEn = companyNameEn;
    }


    public String getCompanyShortNameCn() {
        return companyShortNameCn;
    }


    public void setCompanyShortNameCn(String companyShortNameCn) {
        this.companyShortNameCn = companyShortNameCn;
    }


    public String getCompanyShortNameEn() {
        return companyShortNameEn;
    }


    public void setCompanyShortNameEn(String companyShortNameEn) {
        this.companyShortNameEn = companyShortNameEn;
    }


    public Integer getOrgId() {
        return orgId;
    }


    public void setOrgId(Integer orgId) {
        this.orgId = orgId;
    }


    public Integer getFactoryCompanyId() {
        return factoryCompanyId;
    }


    public void setFactoryCompanyId(Integer factoryCompanyId) {
        this.factoryCompanyId = factoryCompanyId;
    }


    public Integer getValidStatus() {
        return validStatus;
    }


    public void setValidStatus(Integer validStatus) {
        this.validStatus = validStatus;
    }


    public Integer getProvinceId() {
        return provinceId;
    }


    public void setProvinceId(Integer provinceId) {
        this.provinceId = provinceId;
    }


    public Integer getCityId() {
        return cityId;
    }


    public void setCityId(Integer cityId) {
        this.cityId = cityId;
    }


    public String getAddressZh() {
        return addressZh;
    }


    public void setAddressZh(String addressZh) {
        this.addressZh = addressZh;
    }


    public String getAddressEn() {
        return addressEn;
    }


    public void setAddressEn(String addressEn) {
        this.addressEn = addressEn;
    }


    public String getPhone() {
        return phone;
    }


    public void setPhone(String phone) {
        this.phone = phone;
    }


    public String getZipCode() {
        return zipCode;
    }


    public void setZipCode(String zipCode) {
        this.zipCode = zipCode;
    }


    public String getFax() {
        return fax;
    }


    public void setFax(String fax) {
        this.fax = fax;
    }


    public Integer getDataType() {
        return dataType;
    }


    public void setDataType(Integer dataType) {
        this.dataType = dataType;
    }


    public String getTenantId() {
        return tenantId;
    }


    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }


    public LocalDateTime getSourceChangedAt() {
        return sourceChangedAt;
    }


    public void setSourceChangedAt(LocalDateTime sourceChangedAt) {
        this.sourceChangedAt = sourceChangedAt;
    }


    public Integer getCounty() {
        return county;
    }


    public void setCounty(Integer county) {
        this.county = county;
    }


    public String getProperty() {
        return property;
    }


    public void setProperty(String property) {
        this.property = property;
    }


    public String geteMail() {
        return eMail;
    }


    public void seteMail(String eMail) {
        this.eMail = eMail;
    }


    public LocalDateTime getOpenDate() {
        return openDate;
    }


    public void setOpenDate(LocalDateTime openDate) {
        this.openDate = openDate;
    }


    public String getHotLine() {
        return hotLine;
    }


    public void setHotLine(String hotLine) {
        this.hotLine = hotLine;
    }


    public String getSalesLine() {
        return salesLine;
    }


    public void setSalesLine(String salesLine) {
        this.salesLine = salesLine;
    }


    public String getServiceLine() {
        return serviceLine;
    }


    public void setServiceLine(String serviceLine) {
        this.serviceLine = serviceLine;
    }


    public String getBusinessHours() {
        return businessHours;
    }


    public void setBusinessHours(String businessHours) {
        this.businessHours = businessHours;
    }


    public LocalDateTime getCreatedDate() {
        return createdDate;
    }


    public void setCreatedDate(LocalDateTime createdDate) {
        this.createdDate = createdDate;
    }


    public Integer getDealerStatus() {
        return dealerStatus;
    }


    public void setDealerStatus(Integer dealerStatus) {
        this.dealerStatus = dealerStatus;
    }


    public String getCompanyHomepage() {
        return companyHomepage;
    }


    public void setCompanyHomepage(String companyHomepage) {
        this.companyHomepage = companyHomepage;
    }


    public String getRemark() {
        return remark;
    }


    public void setRemark(String remark) {
        this.remark = remark;
    }


    public Integer getIsMain() {
        return isMain;
    }


    public void setIsMain(Integer isMain) {
        this.isMain = isMain;
    }


    public Integer getIsFixed() {
        return isFixed;
    }


    public void setIsFixed(Integer isFixed) {
        this.isFixed = isFixed;
    }


    public String getPartnerId() {
        return partnerId;
    }


    public void setPartnerId(String partnerId) {
        this.partnerId = partnerId;
    }


    public String getPrivateKey() {
        return privateKey;
    }


    public void setPrivateKey(String privateKey) {
        this.privateKey = privateKey;
    }


    public String getPublicKey() {
        return publicKey;
    }


    public void setPublicKey(String publicKey) {
        this.publicKey = publicKey;
    }


    public String getAddressCn() {
        return addressCn;
    }


    public void setAddressCn(String addressCn) {
        this.addressCn = addressCn;
    }


    public Integer getIsDeleted() {
        return isDeleted;
    }


    public void setIsDeleted(Integer isDeleted) {
        this.isDeleted = isDeleted;
    }


    @Override
    public String toString() {
        return "CompanyDTO{" +
                "companyId=" + companyId +
                ", companyCode=" + companyCode +
                ", companyType=" + companyType +
                ", companyNameCn=" + companyNameCn +
                ", companyNameEn=" + companyNameEn +
                ", companyShortNameCn=" + companyShortNameCn +
                ", companyShortNameEn=" + companyShortNameEn +
                ", orgId=" + orgId +
                ", factoryCompanyId=" + factoryCompanyId +
                ", validStatus=" + validStatus +
                ", provinceId=" + provinceId +
                ", cityId=" + cityId +
                ", addressZh=" + addressZh +
                ", addressEn=" + addressEn +
                ", phone=" + phone +
                ", zipCode=" + zipCode +
                ", fax=" + fax +
                ", dataType=" + dataType +
                ", tenantId=" + tenantId +
                ", sourceChangedAt=" + sourceChangedAt +
                ", county=" + county +
                ", property=" + property +
                ", eMail=" + eMail +
                ", openDate=" + openDate +
                ", hotLine=" + hotLine +
                ", salesLine=" + salesLine +
                ", serviceLine=" + serviceLine +
                ", businessHours=" + businessHours +
                ", createdDate=" + createdDate +
                ", dealerStatus=" + dealerStatus +
                ", companyHomepage=" + companyHomepage +
                ", remark=" + remark +
                ", isMain=" + isMain +
                ", isFixed=" + isFixed +
                ", partnerId=" + partnerId +
                ", privateKey=" + privateKey +
                ", publicKey=" + publicKey +
                ", addressCn=" + addressCn +
                ", isDeleted=" + isDeleted +
                "}";
    }

    /**
     * 将DTO 转换为PO
     * //对某个对象属性进行赋值
     * //BeanMapperUtil.populateValueByMethod(transPO,"setXxx",this.getXxx);
     *
     * @param poClass dto 需要转换的dto
     * @author quankk
     * @since 2018/7/22 0022
     */
    @Override
    public <T extends BasePO> T transDtoToPo(Class<T> poClass) {
        return super.transDtoToPo(poClass);
    }

    /**
     * 将DTO 转换为PO
     * BeanMapperUtil.populateValueByMethod(transPO,"setXxx",this.getXxx);
     *
     * @param po 需要转换的对象
     * @author quankk
     * @since 2018/7/22 0022
     */
    public <T extends BasePO> void transDtoToPo(T po) {
        BeanMapperUtil.copyProperties(this, po, "companyId");
    }

}
